#!/bin/sh  

echo 1 > /proc/sys/net/ipv4/ip_forward

cd /usr/bin/wg0
ip link add dev wg0 type wireguard
ip address add dev wg0 192.168.40.2/24
wg setconf wg0 config.conf 
ip link set up dev wg0

ip route add 192.168.20.0/24 via 192.168.40.1
iptables -t nat -I POSTROUTING -s 192.168.20.0/24 -o eth0 -j MASQUERADE
